namespace code
{
	template<class T>
	class unique_ptr
	{
	public:
		//1.RAII
		unique_ptr(T* ptr)
			:_ptr(ptr)
		{}

		~unique_ptr() 
		{
			delete _ptr;
		}

		//2.像指针一样
		T& operator*() { return *_ptr; }
		T* operator->() { return _ptr; }
		
		//3.封拷贝构造和赋值运算符
	private:
		unique_ptr(const unique_ptr<T>& sp) = delete;
		unique_ptr<T>& operator=(const unique_ptr<T>& sp) = delete;

	private:
		T* _ptr;
	};
}